//----导出组件
import type { App } from "vue";

//添加组件.
import { addViteMenus, i18n } from "jmash-core";
// 本地语言包
import { loadLang } from "./lang";

const modules = import.meta.glob("./views/**/**.vue");

import JmashRegionTree from "@/components/JmashRegionTree/index.vue";
import JmashRegionCascader from "@/components/JmashRegionCascader/index.vue";

// 对外暴露组件
export { JmashRegionTree, JmashRegionCascader };

// 对外暴露API
export { dictRegionApi } from "@/api/region/os-dict-region";

// 对外暴露类型
export type {
  DictRegionApi,
  DictRegionReq,
  DictRegionModel,
  DictRegionList,
  DictRegionKey,
  DictRegionMoveKey,
  DictRegionEnableKey,
  DictRegionCreateReq,
  DictRegionUpdateReq,
  DictRegionExportReq,
  DictRegionImportReq,
} from "@/api/region/os-dict-region/types";

// 全局注册Jmash-dict插件.
const dict = {
  install(app: App) {
    addViteMenus(modules, 7);
    loadLang(i18n);
    app.component("JmashRegionTree", JmashRegionTree);
    app.component("JmashRegionCascader", JmashRegionCascader);
  },
};
export default dict;
